#include "M30DownBullet.h"


CM30DownBullet::CM30DownBullet()
{
	position_.x = 100;
	position_.y = 300;

	velocity_.x = 0.5f;
	velocity_.y = 0.1f;

	m30DownBulletShootStatus_ = SHOOT_STATUS;

	LoadSprites();
}


CM30DownBullet::~CM30DownBullet()
{
}


void CM30DownBullet::SetStartCoordinate(float x, float y)
{
	position_.x = x;
	position_.y = y;
}


void CM30DownBullet::Render()
{
	spriteVector_[0]->Render(0, -1, position_);
}


void CM30DownBullet::Update(DWORD deltaTime)
{
	if (m30DownBulletShootStatus_ == SHOOT_0_RIGHT)
		Update0Right(deltaTime);
}


void CM30DownBullet::LoadSprites()
{
	spriteVector_.push_back(new CSprite(S_BULLET_IMAGE, 1, 1, 1));
}


void CM30DownBullet::UpdateKeyBoard(CInput* inputDevice)
{

}


void CM30DownBullet::Update0Right(DWORD deltaTime)
{
	position_.x += velocity_.x * deltaTime;
	position_.y += velocity_.y * deltaTime;
}


void CM30DownBullet::Update0Left(DWORD deltaTime)
{
	position_.x -= velocity_.x * deltaTime;
	position_.y -= velocity_.y * deltaTime;
}


void CM30DownBullet::Update90Up(DWORD deltaTime)
{
	velocity_.x = 0.1f;
	velocity_.y = 0.5f;

	position_.x += velocity_.x * deltaTime;
	position_.y -= velocity_.y * deltaTime;
}


void CM30DownBullet::Update90Down(DWORD deltaTime)
{
	velocity_.x = 0.1f;
	velocity_.y = 0.5f;

	position_.x -= velocity_.x * deltaTime;
	position_.y += velocity_.y * deltaTime;
}


void CM30DownBullet::Update45RightUp(DWORD deltaTime)
{
	velocity_.x = 0.5f;
	velocity_.y = 0.3f;

	position_.x += velocity_.x * deltaTime;
	position_.y -= velocity_.y * deltaTime;
}


void CM30DownBullet::Update45RightDown(DWORD deltaTime)
{
	velocity_.x = 0.3f;
	velocity_.y = 0.5f;

	position_.x += velocity_.x * deltaTime;
	position_.y += velocity_.y * deltaTime;
}


void CM30DownBullet::Update45LeftUp(DWORD deltaTime)
{
	velocity_.x = 0.5f;
	velocity_.y = 0.3f;

	position_.x -= velocity_.x * deltaTime;
	position_.y -= velocity_.y * deltaTime;
}


void CM30DownBullet::Update45LeftDown(DWORD deltaTime)
{
	velocity_.x = 0.5f;
	velocity_.y = 0.3f;

	position_.x -= velocity_.x * deltaTime;
	position_.y += velocity_.y * deltaTime;
}